Support creating new consumer groups, and add "earliest" offset #343
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In our Kafka clusters we do not allow auto-creation of Consumer Groups, as we want that to be a manual step. Given that, Kaf refuses to create a brand new consumer group because the Kafka API reports it's status as
Dead
when it doesn't exist at all. This change teaches Kaf how to create consumer group offsets in this situation.I also added the "earliest" verb to the offset options as an alias to "oldest"... that's the verbiage that the Kafka provided tooling uses, so it's what we are most used to as well. (A nice to have for us... but not strictly necessary for this PR if you'd prefer not to incorporate it.)
(To keep the logic simple, I used
slices.Contains()
, but the Go version of 1.18 ingo.mod
doesn't have the stdlib version ofslices
yet... I'm quite happy to switch that and update to 1.21 or later in thego.mod
file, I just wasn't sure if there was a reason you were holding back so I started with thegolang.org/x/exp/slices
package)